package com.lancoo.examview.kaofu.menuActivity

import android.app.ActivityOptions
import android.content.Intent
import android.os.Bundle
import android.transition.Explode
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.lancoo.answer.view.xgSaResultView.XgSaResultFragment
import com.lancoo.examview.R

/*
* 小鸽AI英语同类题作答结果页面
* */
class XgSaResultActivity: AppCompatActivity() {
    companion object{
        fun launch(activity: AppCompatActivity) {
            val intent = Intent(activity, XgSaResultActivity::class.java)
//            activity.startActivity(intent)
            activity.startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(activity).toBundle())
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_xg_sa_result)

        supportFragmentManager
            .beginTransaction()
            .add(
                R.id.fl_xg_result,
                XgSaResultFragment.loadFragment()
            ) // 此处的R.id.fragment_container是要盛放fragment的父容器
            .commit()

        findViewById<ImageView>(R.id.IvBack).setOnClickListener {
            finish()
        }

        //设置过渡动画
        window.enterTransition = Explode().setDuration(1000)
        window.exitTransition = Explode().setDuration(1000)
    }
}